<?php 
session_start();
$VIEW=true;
if(getinfo($viewId,'title')=='未知'&&getinfo($viewId,'author')=='未知'){include('404.html'); exit;}
$statusword='';//后台预览文章加入的状态
if(getinfo($viewId,'status')!='pub'){
	if($_SESSION[ANY_SESSION.'isAdminLogin']){
		$statusword='<span class="tip">【待审核】</span>';
	}else{ include('404.html'); exit;}
}
//if(isset($_GET['viewid'])){ include('../global.php'); $viewId=$_GET['viewid'];}
$cid=getinfo($viewId,'categoryid');
$cnname=getinfo($cid,'name','categories');
$enname=getinfo($cid,'englishname','categories');
$pgtitle=getinfo($viewId,'title').'-';

//分页开始
$allContent=str_replace('scuec.edu.cn:83','scuec.edu.cn',getinfo($viewId,'content'));
$allContent=str_replace('http://www.scuec.edu.cn/tuanwei/','../',$allContent);
#$allContent=str_replace('"uploadfile','"http://www.scuec.edu.cn/tuanwei/youngth/uploadfile',$allContent);
$allContent=str_replace('face=宋体',' ',$allContent);
$allArray=explode(ANY_PAGEINT,$allContent);
$allPage=count($allArray);
if($viewPage>$allPage||$viewPage<1)
{echo 'Oops,there is nothing...anymoore?';exit;}
$nextPage=$viewPage+1;
$prePage=$viewPage-1;
if($nextPage>$allPage) $nextPage=$allPage;
if($prePage<1) $prePage=1;
$page=$viewPage-1;

//缓存制造
ob_start();
//include(ANYROOT.'include/config.php');
//include($filePath."header.php");
?>
<?php include("header.php"); ?>
	<div id="layout">
		<div class="list box">
			<div class="news_location">
				您现在的位置：
				<a href="../">青年网</a> &gt; <a href="./">青年动态</a> &gt; <a href="./?class-<?=$enname?>.htm"><?=$cnname?></a> &gt; 正文
			</div>
			<div class="news_title"><h1><?=getinfo($viewId,'title').$statusword?></h1></div>
			<div class="news_info">
				来源：民大青年网 作者：<?=getinfo($viewId,'author')?> 编辑：<?=getinfo($viewId,'editor')?> 发布日期：<?=date("Y-m-d H:i",strtotime(getinfo($viewId,'updatetime')))?> 点击：<?=getinfo($viewId,'click')?>
			</div>
			<div class="news_content">
				
					<?php echo $allArray[$page]; ?>
				
			</div>
			<div class="news_bottom"><img src="../src/images/news_bottom.jpg" width="275px" height="65px" alt="" /></div>
			<div class="news_comment"></div>
			<div class="news_warning">注：本站所有文章版权归本站所有，任何人需要转载，必须征得本站授权！</div>
		</div>
<?php include("side.php"); ?>
		<div class="clear"></div>
<?php include("footer.php"); 
	$upsql="UPDATE ".tbname('essay')." SET `essay_click`=`essay_click`+1 WHERE `essay_id`='$viewId'";
mysql_query($upsql);
?>
